<div class="waiversReleases form">
    <?php echo $this->Form->create('WaiversRelease'); ?>
    <fieldset>
        <legend><?php echo __('Waivers & Releases'); ?></legend>
        <?php
        echo $this->Form->input('user_id', array('type' => 'hidden', 'value' => $_SESSION['UserID']));
        echo $this->Form->input('code_of_conduct');
        echo $this->Form->input('photo_releases');
        echo $this->Form->input('video_releases');
        ?>
        <legend><?php echo __('Emergency Contact'); ?></legend>
        <?php
        echo $this->Form->input('first_name');
        echo $this->Form->input('last_name');
        echo $this->Form->input('phone');
        echo $this->Form->input('address');
        echo $this->Form->input('apt_no');
        echo $this->Form->input('city');
        echo $this->Form->input('state_id');
        echo $this->Form->input('zip');
        echo $this->Form->input('relationship_to_participant');
        ?>
        <hr/><br/>
        <?php
        echo $this->Form->input('name_of_insurance');
        echo $this->Form->input('medical_insurance_no');
        echo $this->Form->input('disabilities');
        ?>
        <div class="hidden" id="disable-div">
            <?php
            echo $this->Form->input('disability_explanation');
            ?>
        </div>
        <?php
        echo $this->Form->input('allergy');
        ?>
        <div class="hidden" id="allergy-div">
            <?php
            echo $this->Form->input('allergy_explaination');
            ?>
        </div>
        <?php
        echo $this->Form->input('taking_medication');
        ?>
        <div class="hidden" id="medication-div">
            <?php
            echo $this->Form->input('medication_explaination');
            ?>
        </div>
        <?php
        echo $this->Form->input('digital_signature');
        echo $this->Form->input('digital_date_stamp');
        ?>
    </fieldset>
    <?php echo $this->Form->input('Save Draft',array('id'=>'save-draft','type'=>'button')); ?>
    <?php echo $this->Form->end(__('Next')); ?>
</div>
<script>
    $().ready(function() {
        $("#WaiversReleaseDisabilities").change(function() {

            if ($(this).is(':checked')) {
                $("#disable-div").css('display', 'block');
            } else {
                $("#disable-div").css('display', 'none');
                $("#WaiversReleaseDisabilityExplanation").val('');
            }
        });



        $("#WaiversReleaseAllergy").change(function() {

            if ($(this).is(':checked')) {
                $("#allergy-div").css('display', 'block');
            } else {
                $("#allergy-div").css('display', 'none');
                $("#WaiversReleaseAllergyExplaination").val('');
            }
        });

        $("#WaiversReleaseTakingMedication").change(function() {

            if ($(this).is(':checked')) {
                $("#medication-div").css('display', 'block');
            } else {
                $("#medication-div").css('display', 'none');
                $("#WaiversReleaseMedicationExplaination").val('');
            }
        });
        $("#WaiversReleasePhone").mask("(999) 999-9999");
    });
</script>